<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./style.css" />
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  </head>
  <body>
    <div id="app">
      <h1>Todo List</h1>
      <hr />
      <br />

      <input placeholder="Enter content to add" v-model="inputValue" />
      <br />
      <br />
      <button @click="addTodo">Add</button>
      <br />
      <br />

      <!-- Todo List -->
      <ul>
        <li  v-for="(item,index) in todoList" :key="index" :class="{'done': item.done}">

          {{item.name}}
          <button @click="completeTodo(index)">已完成</button>

          <button @click="removeTodo(index)">&times;</button>

        </li>
      </ul>
    </div>

    <script src="./main.js"></script>
  </body>
</html>
